//
//  BaseSocketManager.h
//  Builder
//
//  Created by JCK on 2017/12/5.
//  Copyright © 2017年 JCK. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef enum
{
    RequestOfOpen = 0,    // 启动
    RequestOfClose,       // 关闭
    
}RequestStates;


typedef void(^SuccessBlock)(id responseBody);
typedef void(^SocketSuccessBlock)(id responseBody);

@protocol BaseSocketManagerDelegate
- (void)passValue:(NSString *)value;
@end

@protocol BaseSocketNewOderDelegate
- (void)NewOderPNo:(NSString *)pno;
@end

#import "GCDAsyncSocket.h" // socket

@interface BaseSocketManager : NSObject

//@property (nonatomic ,copy) NSString *path;
//@property (nonatomic ,copy) NSDictionary *parameters;
@property(nonatomic, retain) NSObject<BaseSocketManagerDelegate> * delegate;
@property(nonatomic, retain) NSObject<BaseSocketNewOderDelegate> * oderPNodelegate;
@property (nonatomic, copy) SocketSuccessBlock socketsuccessblock;

+ (instancetype)shareInstance;
- (instancetype)initWith:(RequestStates)requet;
- (void)sendDataToSocket:(NSString *)data PNo:(NSString *)pno successBlock:(SuccessBlock)successBlock;
+ (void)Socketclose;
+ (void)SocketOpen;
@end
